package com.chalk.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.chalk.model.SysUser;
import com.chalk.vo.SysUserVo;
import com.chalk.vo.UserVo;

import java.util.List;
import java.util.Map;

/**
 * 系统用户表(SysUser)表服务接口
 *
 * @author maxiaoqiang
 * @since 2019-03-22 17:38:25
 */
public interface SysUserService extends IService<SysUser> {

    /*自定义接口*/
    List <SysUser> getUserByUserName(String userName);

    /**
     * 根据主键批量(逻辑)删除
     *
     * @param ids
     * @return
     */
    int deleteBatchByPrimaryKey(String[] ids);

    /**
     * 保存用户和角色关系
     *
     * @param sysUser
     * @return
     */
    boolean insertAndRole(SysUserVo sysUser);

    /**
     * 修改用户和角色关系
     *
     * @param sysUser
     * @return
     */
   boolean updateAndRole(SysUserVo sysUser);


    /**
     * 用户查询
     *
     * @param param
     * @return
     */
    SysUser selectOne(Map<String, Object> param);

    /**
     *
     * @param page
     * @param sysUser
     * @return
     */
    Page<UserVo> getUserByPage(Page<UserVo> page, SysUser sysUser);

    /**
     *通过门店名查询用户列表
     * @param page
     * @param sysUser
     * @return
     */
    List<UserVo> selectListByShopName(Page<UserVo> page, SysUser sysUser);

    /**
     *销售人员查看所属门店
     *
     * @param userId
     * @return
     */
     List<String> searchShopNameByUserId(String userId);


}